<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组</title>
    <script type="text/javascript">
        /**
         * java中创建数组
         * int[] arr1 = new int[]{2,3}；
         *int [] arr3 = new int[4];
         * int [] arr2 = {1,34,5};
         *
         * javaScript中创建数组
         * var arr1 = new Array(5);
         * var arr2 = [1,4,5,6];
         */
        var arr = [34,"hello",34.5,true,new Date()];
        //alert(arr[4]);
       /* for (var i = 0; i < arr.length; i++) {
            alert(arr[i]);
        }*/
       arr[7] ="int";
       alert(arr.length);//8

    </script>
</head>
<body>

</body>
</html>